#include <array>
#include <iostream>
#include <limits>

using namespace std;

int main() {
  // 最好使用long
  cout << numeric_limits<int>::max() << "\n";
  cout << numeric_limits<int>::min() << "\n";
  cout << numeric_limits<long>::max() << "\n";
  cout << numeric_limits<long>::min() << "\n";
  cout << numeric_limits<unsigned>::max() << "\n";
  cout << numeric_limits<unsigned>::min() << "\n";

  cout << sizeof(short) << "\n";
  cout << sizeof(int) << "\n";
  cout << sizeof(long) << "\n";
  cout << sizeof(long long) << "\n";
  cout << sizeof(long double) << "\n";

  // 负数算术移位运算表现同想象不同，不要对负数进行移位代替乘除，不相同。
  int a = -81;
  int c = 81;
  unsigned b = 64;
  cout << "\n\n";
  cout << (a << 1) << "\n";
  cout << (a >> 1) << "\n";

  cout << (b << 1) << "\n";
  cout << (b >> 1) << "\n";

  cout << (c << 1) << "\n";
  cout << (c >> 1) << "\n";
  array<int, 5> arr = {1, 2, 3, 4, 5};
  // 输出的数莫名奇妙，下标的控制由程序员确定
  int d = arr[-10];
  cout << d << "\n";

  // 可以正确初始化
  long lg{10000000000000};
  cout << lg << endl;
  a = lg;
  cout << a << endl;

  return 0;
}